package IC.AST;
import java.util.ArrayList;
import java.util.List;

/**
 
 */
/**
 *  Class which collect methods and fields in the class
 */
public class FieldOrMethod{

	private	ArrayList<Field> fields;
	private  ArrayList<Method> methods;
	/**
	 * Constuctor for empty lists
	 */
	public FieldOrMethod() 	{
		fields = new ArrayList<Field>();
		methods = new ArrayList<Method>();		
	}
	public FieldOrMethod(List<Field> fields) 	{
		fields = new ArrayList<Field>();
		fields.addAll(fields);
		methods = new ArrayList<Method>();		
	}
	
	
	public FieldOrMethod(Method method) 	{
		fields = new ArrayList<Field>();
		methods = new ArrayList<Method>();	
		methods.add(method);
		
	}
	
	/**
	 * Add field in the end of the field list
	 * @param field 
	 */
	public void addField(Field field) {
		fields.add(field);
	}
	/**
	 * Add collection of field in the of the field list
	 * @param fields
	 */
	public void addAllFields(List<Field> fields){
		this.fields.addAll(fields);
	}
	/**
	 * 
	 * @return Field list
	 */
	public ArrayList<Field> getFields() {
		return fields;
	}
	/**
	 * Add method in the end of the method list
	 * @param method 
	 */
	public void addMethod(Method method) {
		methods.add(method);
	}
	/**
	 * 
	 * @return Method list
	 */
	public ArrayList<Method> getMethods() {
		return methods;
	}
}
